;; The first four lines of this file were added by Dracula.
;; They tell DrScheme that this is a Dracula Modular ACL2 program.
;; Leave these lines unchanged so that DrScheme can properly load this file.
#reader(planet "reader.rkt" ("cce" "dracula.plt") "modular" "lang")
(require "Ischedule-criterion.lisp")
(require "Iformulas-aux.lisp")
(require "Itranspose-fast.lisp")
(require "Ilist.lisp")

(module Mschedule-criterion
  
(import Iformulas-aux)
(import Itranspose-fast)
(import Ilist)

  (defconst *K* 48)
  

(defun calculate-team-schedule-score-aux
  (list-of-team-member-time-avalability-transpose)
  (if (consp list-of-team-member-time-avalability-transpose)
      (cons (- 1
               (binary-or
                (car list-of-team-member-time-avalability-transpose)))
            (calculate-team-schedule-score-aux
             (cdr list-of-team-member-time-avalability-transpose)))
      nil))

(defun calculate-team-schedule-score
  (list-of-all-team-member-data-by-criterion schedule-weight)
  (if (not (or (endp list-of-all-team-member-data-by-criterion)
               (zerop schedule-weight)))
      (* (max (/ (sumlist
                  (calculate-team-schedule-score-aux
                   (transpose-fast
                    (car (cddddr
                          list-of-all-team-member-data-by-criterion)))))
                 *K*)
              1)
         schedule-weight)
      0))

  (export Ischedule-criterion))

